/*********************\
* Author:Dzlua
* QQ:505544956
* Time:2017/03/20
\**********************/
#ifndef __SD_ISCRIPT_H__
#define __SD_ISCRIPT_H__
#pragma once
namespace DuiLib {

enum SPDUI_MSG
{
    SPDUI_MSG_NULL = 0,
    SPDUI_MSG_ON_CREATE,
    SPDUI_MSG_ON_ZOOMED,
    SPDUI_MSG_ON_NOTIFY,
    SPDUI_MSG_ON_CREATECONTROL,

    SPDUI_MSG_ON_CLOSE = 101,
    SPDUI_MSG_ON_DESTROY,
    SPDUI_MSG_ON_KEYDOWN,
    SPDUI_MSG_ON_KEUP,
    SPDUI_MSG_ON_SETFOCUS,
    SPDUI_MSG_ON_KILLFOCUS,
};

class SDWindow;
class CControlUI;

class SDIScript
{
public:
    //it will be called automatic
    virtual void Quit() = 0;
    virtual void* HandleMessage(SDWindow* wnd, SPDUI_MSG msg, void* data1 = 0, void* data2 = 0) = 0;
    // called by SDWindow::~OnFinalMessage
    virtual void RemoveWnd(SDWindow* wnd) = 0;
    // called by CControlUI::~CControlUI->SDWindow::~OnRemoveControl
    virtual void RemoveCtrl(SDWindow* wnd, CControlUI* ctrl) = 0;
    // called by CDialogBuilder::_Parse->SDWindow::~OnAfterCreateControl
    virtual void AddCtrl(SDWindow* wnd, CControlUI* ctrl, LPCTSTR ctrlmetaname) = 0;
    // called by SDWindow::SDWindow
    virtual void AddWnd(SDWindow* wnd, LPCTSTR metaname) = 0;
};

}
#endif //__SD_ISCRIPT_H__
